package com.yhh.yapiclientsdk;

import com.yhh.yapiclientsdk.client.YApiClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author hyh
 * @date 2024/8/7
 * @description
 */
@Configuration //标记为配置类，告诉Spring这是一个用于配置的类
@ConfigurationProperties("yapi.client")//读取application.yml的配置，并设置到类的属性中
@Data
@ComponentScan//用于自动扫描组件，使得Spring能够自动注册相应的Bean
public class YApiClientConfig {
    private String accessKey;
    private String secretKey;


    @Bean
    public YApiClient yApiClient() {
        return new YApiClient(accessKey,secretKey);
    }
}
